<html>
<head>
<title>StudentController.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.s0 { color: #cf8e6d;}
.s1 { color: #bcbec4;}
.s2 { color: #bcbec4;}
.s3 { color: #6aab73;}
</style>
</head>
<body bgcolor="#1e1f22">
<table CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#606060" >
<tr><td><center>
<font face="Arial, Helvetica" color="#000000">
StudentController.java</font>
</center></td></tr></table>
<pre><span class="s0">package </span><span class="s1">com</span><span class="s2">.</span><span class="s1">example</span><span class="s2">.</span><span class="s1">demo</span><span class="s2">.</span><span class="s1">controller</span><span class="s2">;</span>

<span class="s0">import </span><span class="s1">com</span><span class="s2">.</span><span class="s1">example</span><span class="s2">.</span><span class="s1">demo</span><span class="s2">.</span><span class="s1">entity</span><span class="s2">.</span><span class="s1">StudentInfo</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">com</span><span class="s2">.</span><span class="s1">example</span><span class="s2">.</span><span class="s1">demo</span><span class="s2">.</span><span class="s1">mapper</span><span class="s2">.</span><span class="s1">StudentMapper</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">com</span><span class="s2">.</span><span class="s1">example</span><span class="s2">.</span><span class="s1">demo</span><span class="s2">.</span><span class="s1">service</span><span class="s2">.</span><span class="s1">StudentService</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">org</span><span class="s2">.</span><span class="s1">springframework</span><span class="s2">.</span><span class="s1">beans</span><span class="s2">.</span><span class="s1">factory</span><span class="s2">.</span><span class="s1">annotation</span><span class="s2">.</span><span class="s1">Autowired</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">org</span><span class="s2">.</span><span class="s1">springframework</span><span class="s2">.</span><span class="s1">stereotype</span><span class="s2">.</span><span class="s1">Service</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">org</span><span class="s2">.</span><span class="s1">springframework</span><span class="s2">.</span><span class="s1">web</span><span class="s2">.</span><span class="s1">bind</span><span class="s2">.</span><span class="s1">annotation</span><span class="s2">.</span><span class="s1">GetMapping</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">org</span><span class="s2">.</span><span class="s1">springframework</span><span class="s2">.</span><span class="s1">web</span><span class="s2">.</span><span class="s1">bind</span><span class="s2">.</span><span class="s1">annotation</span><span class="s2">.</span><span class="s1">RequestMapping</span><span class="s2">;</span>
<span class="s0">import </span><span class="s1">org</span><span class="s2">.</span><span class="s1">springframework</span><span class="s2">.</span><span class="s1">web</span><span class="s2">.</span><span class="s1">bind</span><span class="s2">.</span><span class="s1">annotation</span><span class="s2">.</span><span class="s1">RestController</span><span class="s2">;</span>

<span class="s0">import </span><span class="s1">java</span><span class="s2">.</span><span class="s1">util</span><span class="s2">.</span><span class="s1">List</span><span class="s2">;</span>
<span class="s1">@RestController</span>
<span class="s1">@RequestMapping</span><span class="s2">(</span><span class="s3">&quot;/stu&quot; </span><span class="s2">)</span>
<span class="s0">public class </span><span class="s1">StudentController </span><span class="s2">{</span>
    <span class="s1">@Autowired</span>

    <span class="s0">private </span><span class="s1">StudentService studentService</span><span class="s2">;</span>

    <span class="s1">@GetMapping</span><span class="s2">(</span><span class="s3">&quot;/abc&quot;</span><span class="s2">)</span>
    <span class="s0">public </span><span class="s1">String getStudent</span><span class="s2">(){</span>
        <span class="s1">System</span><span class="s2">.</span><span class="s1">out</span><span class="s2">.</span><span class="s1">println</span><span class="s2">(</span><span class="s3">&quot;getStudent&quot;</span><span class="s2">);</span>
        <span class="s0">return </span><span class="s3">&quot;Student20250517&quot;</span><span class="s2">;</span>
    <span class="s2">}</span>
    <span class="s1">@GetMapping</span><span class="s2">(</span><span class="s3">&quot;/list&quot;</span><span class="s2">)</span>
    <span class="s0">public </span><span class="s1">List</span><span class="s2">&lt;</span><span class="s1">StudentInfo</span><span class="s2">&gt; </span><span class="s1">getStudentList</span><span class="s2">(){</span>
        <span class="s1">List</span><span class="s2">&lt;</span><span class="s1">StudentInfo</span><span class="s2">&gt;</span><span class="s1">studentInfo </span><span class="s2">= </span><span class="s1">studentService</span><span class="s2">.</span><span class="s1">getStudentInfo</span><span class="s2">();</span>
        <span class="s0">return </span><span class="s1">studentInfo</span><span class="s2">;</span>

    <span class="s2">}</span>
<span class="s2">}</span>
</pre>
</body>
</html>